#ifndef DEVICESYNC_H
#define DEVICESYNC_H

#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include <QUdpSocket>
#include "xmlinterface.h"

class DeviceSync : public QObject
{
    Q_OBJECT
public:
    explicit DeviceSync(QObject *parent = 0);

    void setXmlInt(XMLInterface *xmlint);

    void sendToClient();

private:
    QTcpServer *serv;
    std::vector<QTcpSocket *> clients;
    XMLInterface *xml;
    enum commands { GET_XML, SEND_XML, SEND_COORDS, SEND_MAIN_AUD, SEND_AUD, SEND_VID, SEND_PIC };

    void getClientData(QTcpSocket *sock);

signals:

public slots:

private slots:
    void handleConnection();
    void clientDisconnect();

};

#endif // DEVICESYNC_H
